#ifndef WAITCARWINDOW_H
#define WAITCARWINDOW_H

#include <QMainWindow>
#include "mapprocess/mapprocessor.h"
#include "IInterface.h"
#include "globalParameter.h"
#include "socket/protocol/GetOnCar.h"

namespace Ui {
    class WaitCar;
}
namespace interface
{
class CWaitCarWindow : public IInterface
{
    Q_OBJECT

public:
    explicit CWaitCarWindow(IInterface *parent = 0, PORDER_INFO pOrderInfo = 0);
    ~CWaitCarWindow();

    enum ScreenOrientation {
        ScreenOrientationLockPortrait,
        ScreenOrientationLockLandscape,
        ScreenOrientationAuto
    };

    // Note that this will only have an effect on Symbian and Fremantle.
    void setOrientation(ScreenOrientation orientation);

    void showExpanded();

    // initialize coordinate, which will be invoked when build a new window
    void WaitCarStart(long peopleLat,long peopleLon,long carLat,long carLon);
    // coordinates will be changed every several seconds, and this function will be invoked at that time
    void WaitCarChangePos(long peopleLat,long peopleLon,long carLat,long carLon);

private:
    // quest should be resent to the server if no answer is got from server since the last request
    void ResendStartStates();

public Q_SLOTS:
    void OrderCancel();
    void GetOn();
    void MapOnLoad();

private Q_SLOTS:
    // slots for network
    void readResult();
    void socketError();

private:
    Ui::WaitCar *m_pUi;
    MapProcessor * m_mapProcessor;

    QString m_ordeId;
    QString m_driverName;
    QString m_licenceNumber;
    QString m_mobileNumber;
    int m_arrivingTime;

    protocal::GetOnCar *m_pGetOnCarParam;

private:
    void UiSetting(Ui::WaitCar *m_pUi);
};
}
#endif // WAITCARWINDOW_H
